package com.ys.filelib.filedialog.adapter;


import com.ys.filelib.R;
import com.ys.filelib.filedialog.FileShowStyle;
import com.ys.filelib.filedialog.adapter.base.MultiItemType;

public class FileTypeDelegate<T> extends MultiItemType<T> {

    private int mShowStyle = FileShowStyle.STYLE_GRID;

    public FileTypeDelegate() {
        addItemType(FileShowStyle.STYLE_LIST, R.layout.filelib_item_file_list);
        addItemType(FileShowStyle.STYLE_GRID, R.layout.filelib_item_file);
    }

    public void setShowStyle(int style) {
        this.mShowStyle = style;
    }

    public int getShowStyle() {
        return mShowStyle;
    }

    @Override
    public int getItemType(T item, int position) {
        return mShowStyle;
    }
}
